# 安装依赖
#yum -y install wget gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel
dnf -y install wget gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel libffi-devel

# 下载并解压Python 3.7源码
# wget https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz
# tar -zxvf Python-3.7.9.tgz
cd Python-3.7.9

# 配置、编译和安装
./configure --enable-optimizations --with-ssl
# 运行con脚本，开启优化编译、支持ssl
make -j$(nproc)
# 用make编译
make install

# 验证安装
python3.7 --version
# 输出版本号